<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>Nordic Thingy:52 v2.2.0 : MPU-9250 motion sensor</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet_offline.css" rel="stylesheet" type="text/css"/>
<link href="nordic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" width="100%" class="blank">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Nordic Semiconductor" src="nordic_small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Nordic Thingy:52 v2.2.0
   </div>
  </td>
 </tr>
 </tbody>
</table>
<script>
var url=window.location.href.split("/").reverse()[1];
var validLinks= ["nrf5","s130","s132","s212","s332"];
var index;
for (index = 0; index < validLinks.length; ++index) {
   if ( url.indexOf(validLinks[index]) !== -1 ) {
      document.getElementById(validLinks[index]).setAttribute('class', 'doclinks docselected');
   };
};
</script>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__mpu9250__motion__sensor.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">MPU-9250 motion sensor<div class="ingroups"><a class="el" href="group__drivers.html">Drivers</a> &raquo; <a class="el" href="group__motion__driver.html">Motion sensor</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>MPU-9250 motion sensor.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structdrv__mpu9250__init__t.html">drv_mpu9250_init_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">TWI communication initialization struct.  <a href="structdrv__mpu9250__init__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga7f530217c4dcb26bc33f3cbd27583116"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mpu9250__motion__sensor.html#ga7f530217c4dcb26bc33f3cbd27583116">drv_mpu9250_enable</a> (bool enable)</td></tr>
<tr class="memdesc:ga7f530217c4dcb26bc33f3cbd27583116"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for enabling or disabling the MPU-9250 driver.  <a href="#ga7f530217c4dcb26bc33f3cbd27583116">More...</a><br /></td></tr>
<tr class="separator:ga7f530217c4dcb26bc33f3cbd27583116"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga01ec91c643b1d26846acc8b4dc2a167d"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mpu9250__motion__sensor.html#ga01ec91c643b1d26846acc8b4dc2a167d">drv_mpu9250_init</a> (<a class="el" href="structdrv__mpu9250__init__t.html">drv_mpu9250_init_t</a> *p_params)</td></tr>
<tr class="memdesc:ga01ec91c643b1d26846acc8b4dc2a167d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for initializing the MPU-9250 driver.  <a href="#ga01ec91c643b1d26846acc8b4dc2a167d">More...</a><br /></td></tr>
<tr class="separator:ga01ec91c643b1d26846acc8b4dc2a167d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga74b179c1a6cb5c1fe38fe796adc05f36"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mpu9250__motion__sensor.html#ga74b179c1a6cb5c1fe38fe796adc05f36">drv_mpu9250_int_register</a> (struct int_param_s *p_int_param)</td></tr>
<tr class="memdesc:ga74b179c1a6cb5c1fe38fe796adc05f36"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for enabling and registering the MPU-9250 interrupt callback.  <a href="#ga74b179c1a6cb5c1fe38fe796adc05f36">More...</a><br /></td></tr>
<tr class="separator:ga74b179c1a6cb5c1fe38fe796adc05f36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacd673eb36a4c29431083877a8a3673c7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mpu9250__motion__sensor.html#gacd673eb36a4c29431083877a8a3673c7">drv_mpu9250_ms_get</a> (unsigned long *p_count)</td></tr>
<tr class="memdesc:gacd673eb36a4c29431083877a8a3673c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for getting a timestamp in milliseconds.  <a href="#gacd673eb36a4c29431083877a8a3673c7">More...</a><br /></td></tr>
<tr class="separator:gacd673eb36a4c29431083877a8a3673c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacec9a066e84506ac2426722bc0f77ee8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mpu9250__motion__sensor.html#gacec9a066e84506ac2426722bc0f77ee8">drv_mpu9250_read</a> (unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char *p_data)</td></tr>
<tr class="memdesc:gacec9a066e84506ac2426722bc0f77ee8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for reading a MPU-9250 register.  <a href="#gacec9a066e84506ac2426722bc0f77ee8">More...</a><br /></td></tr>
<tr class="separator:gacec9a066e84506ac2426722bc0f77ee8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3ffe5d7b2b20a01ba3f2879838db3de0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__mpu9250__motion__sensor.html#ga3ffe5d7b2b20a01ba3f2879838db3de0">drv_mpu9250_write</a> (unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char const *p_data)</td></tr>
<tr class="memdesc:ga3ffe5d7b2b20a01ba3f2879838db3de0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function for writing to a MPU-9250 register.  <a href="#ga3ffe5d7b2b20a01ba3f2879838db3de0">More...</a><br /></td></tr>
<tr class="separator:ga3ffe5d7b2b20a01ba3f2879838db3de0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>MPU-9250 motion sensor. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga7f530217c4dcb26bc33f3cbd27583116"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7f530217c4dcb26bc33f3cbd27583116">&#9670;&nbsp;</a></span>drv_mpu9250_enable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t drv_mpu9250_enable </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for enabling or disabling the MPU-9250 driver. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>Enables the device.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">NRF_SUCCESS.</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga01ec91c643b1d26846acc8b4dc2a167d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga01ec91c643b1d26846acc8b4dc2a167d">&#9670;&nbsp;</a></span>drv_mpu9250_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t drv_mpu9250_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structdrv__mpu9250__init__t.html">drv_mpu9250_init_t</a> *&#160;</td>
          <td class="paramname"><em>p_params</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for initializing the MPU-9250 driver. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_params</td><td>Pointer to the init paramter structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">NRF_SUCCESS.</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga74b179c1a6cb5c1fe38fe796adc05f36"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga74b179c1a6cb5c1fe38fe796adc05f36">&#9670;&nbsp;</a></span>drv_mpu9250_int_register()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int drv_mpu9250_int_register </td>
          <td>(</td>
          <td class="paramtype">struct int_param_s *&#160;</td>
          <td class="paramname"><em>p_int_param</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for enabling and registering the MPU-9250 interrupt callback. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_int_param</td><td>Pointer to the interrupt parameter structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>if success. Else -1. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gacd673eb36a4c29431083877a8a3673c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacd673eb36a4c29431083877a8a3673c7">&#9670;&nbsp;</a></span>drv_mpu9250_ms_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int drv_mpu9250_ms_get </td>
          <td>(</td>
          <td class="paramtype">unsigned long *&#160;</td>
          <td class="paramname"><em>p_count</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for getting a timestamp in milliseconds. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">p_count</td><td>Pointer to the timestamp.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>if success. Else -1. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gacec9a066e84506ac2426722bc0f77ee8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacec9a066e84506ac2426722bc0f77ee8">&#9670;&nbsp;</a></span>drv_mpu9250_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int drv_mpu9250_read </td>
          <td>(</td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>slave_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>reg_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char *&#160;</td>
          <td class="paramname"><em>p_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for reading a MPU-9250 register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">slave_addr</td><td>Slave address on the TWI bus. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">reg_addr</td><td>Register address to read. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">length</td><td>Length of the data to read. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">p_data</td><td>Pointer to where the data should be stored.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>if success. Else -1. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga3ffe5d7b2b20a01ba3f2879838db3de0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3ffe5d7b2b20a01ba3f2879838db3de0">&#9670;&nbsp;</a></span>drv_mpu9250_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int drv_mpu9250_write </td>
          <td>(</td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>slave_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>reg_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char const *&#160;</td>
          <td class="paramname"><em>p_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Function for writing to a MPU-9250 register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">slave_addr</td><td>Slave address on the TWI bus. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">reg_addr</td><td>Register address to write. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">length</td><td>Length of the data to write. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_data</td><td>Pointer to the data to write.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">0</td><td>if success. Else -1. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="topicfooter">
<a href="mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback" id="maillink">Documentation feedback</a> | <a href="https://devzone.nordicsemi.com/questions/" target="_blank">Developer Zone</a> | <a href="http://response.nordicsemi.com/subscribe-to-our-newsletters" target="_blank">Subscribe</a> | Updated <span id="date"/>
<script>
var date = new Date("Thu Feb 7 2019" + " UTC");
document.getElementById("date").innerHTML = date.toJSON().slice(0, 10);
var url=window.location.href.split("?")[0];
var filename=url.substring(url.lastIndexOf('/')+1);
document.getElementById("maillink").href = "mailto:docfeedback@nordicsemi.no?subject=Documentation%20feedback"+decodeURIComponent("%26")+"body=File%20name%3A%20"+encodeURIComponent(filename);
</script>
</div>
</body>
</html>
